@extends('admin.layout.index')

@section('content')
<div class="mws-panel grid_8">

                	<div class="mws-panel-header">
                    	<span><i class="icon-table"></i>
                                            @if($data && $data['0']['ostatus'] == 1) 备货订单
                                            @endif
                                            @if($data && $data['0']['ostatus'] == 2) 出货订单
                                            @endif
                                            @if($data && $data['0']['ostatus'] == 3) 退货订单
                                            @endif
                                            @if($data && $data['0']['ostatus'] == 4) 完成订单 
                                            @elseif(!$data['0']['ostatus'] == 4)暂无订单
                                            @endif
                                           </span> 
                    </div>
                    <div class="mws-panel-body no-padding">
                        <div id="DataTables_Table_1_wrapper" class="dataTables_wrapper" role="grid">
                            <form @if($data['ostatus'] == 1) action="/admin/order/beihuo" @elseif($data['ostatus'] == 2) action="/admin/order/chuhuo" @elseif($data['ostatus'] == 3) action="/admin/order/tuihuo" @elseif($data['ostatus'] == 4) action="/admin/order/wancheng" @endif method="get">
                             {{ csrf_field() }}   
                            <div id="DataTables_Table_1_length" class="dataTables_length">
                                <label>显示<select size="1" name="count" aria-controls="DataTables_Table_1">
                                    <option value="5" @if(!empty($request['count']) && $request['count'] == 5) selected @endif>5</option>
                                    <option value="10" @if(!empty($request['count']) && $request['count'] == 10) selected @endif>10</option>
                                    <option value="20" @if(!empty($request['count']) && $request['count'] == 20) selected @endif>20</option>
                                    <option value="100" @if(!empty($request['count']) && $request['count'] == 100) selected @endif>100</option></select> 结束</label>
                            </div><div class="dataTables_filter" id="DataTables_Table_1_filter">
                                <label>搜索: <input type="text" name="search" value="{{ $request['search'] or '' }}"></label>
                                <input type="submit" value="搜索">
                            </div>
                            </form>    
                            <table class="mws-datatable-fn mws-table dataTable" id="DataTables_Table_1" aria-describedby="DataTables_Table_1_info">
                            <thead>
                                <tr role="row">
                                	<th class="" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" aria-sort="ascending" aria-label="Rendering engine: activate to sort column descending" style="width: 154px;">订单编号</th>
                                	<th class="" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending" style="width: 223px;">下单时间</th>
                                	<th class="" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" aria-label="Platform(s): activate to sort column ascending" style="width: 194px;">订单价格</th>
                                	<th class="" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" aria-label="Engine version: activate to sort column ascending" style="width: 130px;">订单状态</th>
                                	<th class="" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" aria-label="CSS grade: activate to sort column ascending" style="width: 94px;">操作</th></tr>
                            </thead>
                            
                       		<tbody role="alert" aria-live="polite" aria-relevant="all">
                                @foreach($data as $k => $v)	
                            	<tr class="odd">
                                        <td class="  sorting_1" style="text-align:center;">{{ $v['oid'] }}</td>
                                        <td class=" " style="text-align:center;">{{ $v['otime'] }}</td>
                                        <td class=" " style="text-align:center;">{{ $v['oprice'] }}</td>
                                        <td class=" " style="text-align:center;">
                                            @if($v['ostatus'] == 1) 备货中.... 
                                            @elseif($v['ostatus'] == 2) 出货中.... 
                                            @elseif($v['ostatus'] == 3) 退货中....
                                            @elseif($v['ostatus'] == 4) 完成订单 @endif           
                                        </td>
                                        <td class="">
                                        	<a href="/admin/order/delete/{{ $v['oid'] }}" title='删除' style="font-size:30px; color:black; margin-left:15px;"><i class="icon-trash"></i></a>
                                        	<a href="/admin/order/edit/{{ $v['oid'] }}" title='修改' style="font-size:30px; color:black; margin-left:20px;"><i class="icon-pencil-2"></i></a>
                                        </td>
                                </tr>
                                @endforeach    
                        	</tbody>
                        	</table>
		                	<div id="page_page">
                                <!-- <i class="icol-book-next"></i> -->
				                {!! $data->appends($request)->render() !!}
                                <!-- <i class="icol-book-previous"></i> -->
							</div>
	                	</div>
                    </div>
                </div>
@endsection

